import request from '@/utils/request'

export default {
  //添加照片
  savePhotos(photo) {
    return request({
      url: `/admin/photo`,
      method: 'post',
      data: photo
    })
  },
  //修改照片
  updatePhoto(photo) {
    return request({
      url: `/admin/photo`,
      method: 'put',
      data: photo
    })
  },
  //删除或恢复照片
  logicDelete(data) {
    return request({
      url: `/admin/photos`,
      method: 'put',
      data: data
    })
  },
  //彻底删除照片
  delete(idList) {
    return request({
      url: `/admin/photos`,
      method: 'delete',
      data: idList
    })
  },
   //移动照片
   movePhoto(data) {
    return request({
      url: `/admin/photo/move`,
      method: 'post',
      data: data
    })
  },
  //获取照片列表(后端)
  getList(condition) {
    return request({
      url: `/admin/photos`,
      method: 'get',
      params: { ...condition }
    })
  },
  //通过id获取照片(后端)
  getById(id) {
    return request({
      url: `/admin/photo/${id}`,
      method: 'get',
    })
  }
}